# -*- coding: utf-8 -*-
"""
| ==============================================
|
|   Copyright (c) 2025 Nuoyan
|
|   Author: Nuoyan
|   Email : 1279735247@qq.com
|   Gitee : https://gitee.com/charming-lee
|   Date  : 2025-09-06
|
| ==============================================
"""


from types import MethodType, FunctionType, GeneratorType
from typing import TypeVar, Callable, Any, Type, Optional, Dict, overload, Union, ClassVar
from ._types._typing import ITuple


_T = TypeVar("_T")
_T_Type = TypeVar("_T_Type", bound=type)
_T_CO = TypeVar("_T_CO", bound=CachedObject)


def with_metaclass(metacls: Type[_T], *bases: type) -> _T: ...
def kwargs_setter(**kwargs: Any) -> Callable[[_T], _T]: ...
def try_exec(func: Callable, *args: Any, **kwargs: Any) -> Union[Any, Exception]: ...
def iter_obj_attrs(obj: Any) -> GeneratorType[Any, None, None]: ...
def get_func(cls: type, module: ITuple, func: ITuple) -> FunctionType: ...
def assert_error(func: Callable, args: tuple, *error: Exception) -> None: ...


class cached_property(object):
    __doc__: Optional[str]
    getter: Callable[[Any], Any]
    def __init__(self: ..., getter: Callable[[Any], Any]) -> None: ...
    def __get__(self, ins: Any, cls: type) -> Any: ...


def join_chr(*seq: int) -> str: ...


class CachedObject(object):
    __cache__: ClassVar[Dict[tuple, CachedObject]]
    def __new__(cls: Type[_T_CO], *args: Any, **kwargs: Any) -> _T_CO: ...
    @classmethod
    def __cache_key__(cls, *args: Any, **kwargs: Any) -> tuple: ...


def hook_method(org_method: MethodType, my_method: MethodType) -> None: ...
def cached_method(method: Callable) -> Callable: ...
def cached_func(func: Callable) -> Callable: ...
@overload
def singleton(init_once: bool = True) -> Callable[[_T_Type], _T_Type]: ...
@overload
def singleton(cls: _T_Type) -> _T_Type: ...
def is_inv36_key(k: str) -> bool: ...
def is_inv27_key(k: str) -> bool: ...
def is_shortcut_key(k: str) -> bool: ...
def is_inv_key(k: str) -> bool: ...
def is_not_inv_key(k: str) -> bool: ...
